package com.easy.work.function.main;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.easy.work.MainActivity;
import com.easy.work.R;
import com.easy.work.app.BaseActivity;
import com.easy.work.function.main.fragment.InputRecommendFragment;
import com.easy.work.type.DeliveryType;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by admin on 2017/12/19.
 * 报名成功
 */
public class SignUpSuccessAct extends BaseActivity {
    @BindView(R.id.tv_success_title)
    TextView tvSuccessTitle;
    @BindView(R.id.tv_success_message)
    TextView tvSuccessMessage;
    @BindView(R.id.btn_back_main)
    Button btnBackMain;

    public static void start(Context context, DeliveryType deliveryType) {
        Intent intent = new Intent(context, SignUpSuccessAct.class);
        intent.putExtra("deliveryType", deliveryType);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_sign_up_success);
        ButterKnife.bind(this);
        initTitle("详情");
        DeliveryType deliveryType = (DeliveryType) getIntent().getSerializableExtra("deliveryType");
        if (deliveryType.equals(DeliveryType.Recommend)) {
            tvSuccessTitle.setText("恭喜你！推荐成功～");
            tvSuccessMessage.setVisibility(View.GONE);
        } else if (deliveryType.equals(DeliveryType.SignUp)) {
            tvSuccessTitle.setText("恭喜你！报名成功～");
            tvSuccessMessage.setVisibility(View.VISIBLE);
            tvSuccessMessage.setText("请在我的工作中查看报名情况");
        }

    }

    @OnClick(R.id.btn_back_main)
    public void onViewClicked() {
        MainActivity.startActivity(this);
    }
}
